@echo off


:GETCHOICE
@echo.

@echo Enter choice: 
@echo **************************
@echo	1  ServerUtils.ps1 	(Server Powershell Utilities)        
@echo	2  ServerUtils+ 	(Above +Info for All EDW Servers)
@echo	3  SQLUtils 		(SQLInfo for All EDW Servers)
@echo	4  SQLUtils+ 		(Above +Info for All EDW SQL Servers)
@echo	q  Quit
@echo **************************

SET /P Choice=Enter menu number e.g. 1,2,3...or q to quit? 


@echo.
IF /I '%Choice%'=='1' GOTO CHOICE1
IF /I '%Choice%'=='2' GOTO CHOICE2
IF /I '%Choice%'=='3' GOTO CHOICE3
IF /I '%Choice%'=='4' GOTO CHOICE4
IF /I '%Choice%'=='q' GOTO CHOICEq
ECHO "%Choice%" is not valid.
ECHO.
GOTO GETCHOICE


:CHOICE1
@echo.
@echo running ServerUtils.ps1
SET  file=".\ServerUtils.ps1"
GOTO RUN_POWERSHELL

:CHOICE2
@echo.
@echo running ServerUtils_Info.ps1
SET  file=".\ServerUtils_info.ps1"
GOTO RUN_POWERSHELL

:CHOICE3
@echo.
@echo running SQLServerUtilsUtils.ps1
PUSHD .\sql
SET  file=".\SQLServerUtils.ps1"
GOTO RUN_POWERSHELL

:CHOICE4
@echo.
@echo running ServerInfo.ps1
PUSHD .\sql
SET  file=".\SQLServerInfo.ps1"
GOTO RUN_POWERSHELL


:RUN_POWERSHELL
@echo *** Note: type to exit Powershell type EXIT ***
@echo .
powershell -noexit -File "%file%"
POPD
GOTO EXIT

:CHOICEq
@echo bye

:EXIT
POPD
@echo.
